﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowNowRoom.aspx.cs" Inherits="iEN.Immediate.ShowNowRoom" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 150px;
        }
        .style2
        {
            width: 300px;
        }
        .style3
        {
            width: 150px;
            height: 23px;
        }
        .style4
        {
            width: 300px;
            height: 23px;
        }
    </style>


</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>



    <asp:Panel ID="Panel1" runat="server" Font-Names="微軟正黑體" Font-Size="Larger" 
        ForeColor="Black" GroupingText="宿舍用電管理系統" Width="730px">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <asp:Timer ID="Timer1" runat="server" Interval="10000" ontick="Timer1_Tick">
            </asp:Timer>
                <asp:Label ID="lblMsg" runat="server" Font-Size="Larger" ForeColor="Red"></asp:Label>
                <div id="divTable" runat="server">
                <table style="border: 3px none #FFFF66 ; font-size: medium" rules="all">
                    <tr style="background-color: #FFFFCC">
                        <td colspan="2" align="center" style="font-size: large; font-weight: bold;">寢室電錶資訊</td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style1">寢室名稱</td>
                        <td class="style2">
                            <asp:Label ID="lblRoom" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFCC">
                        <td class="style1">電表號碼</td>
                        <td class="style2">
                            <asp:Label ID="lblMeterNum" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style1">電表累積KWH</td>
                        <td class="style2">
                            <asp:Label ID="lblkWH" runat="server"></asp:Label>
                            &nbsp;
                            <asp:Button ID="btnReset" runat="server" Text="歸零" onclick="btnReset_Click" />
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFCC">
                        <td class="style1">電表狀態</td>
                        <td class="style2">
                            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/green15.gif" />
                            <asp:Label ID="lblStatus" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style1">電錶供電控制</td>
                        <td class="style2">
                            <asp:Button ID="btnRelay" runat="server" Text="供電" onclick="btnRelay_Click" 
                                onclientclick="if (confirm('確定要修改電錶供電狀態？') == false) {return false;}" />
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFCC">
                        <td class="style1">電表時間</td>
                        <td class="style2">
                            <asp:Label ID="lblTime" runat="server"></asp:Label>
                            <asp:Button ID="btnSyn" runat="server" Text="與電腦同步" onclick="btnSyn_Click" 
                                onclientclick="if (confirm('確定要同步此電錶時間？') == false) {return false;}" />
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style3">ModbusAddr</td>
                        <td class="style4">
                            <asp:Label ID="lblModbusAdd" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFCC">
                        <td class="style1">IP : port</td>
                        <td class="style2">
                            <asp:Label ID="lblIPPort" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style1">PortName</td>
                        <td class="style2">
                            <asp:Label ID="lblPortName" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFCC">
                        <td class="style1">Baud Rate</td>
                        <td class="style2">
                            <asp:Label ID="lblBaudRate" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style1">Parity Check</td>
                        <td class="style2">
                            <asp:Label ID="lblParity" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFCC">
                        <td class="style1">Data Bit</td>
                        <td class="style2">
                            <asp:Label ID="lblDataBit" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr style="background-color: #FFFFFF">
                        <td class="style3">Stop Bit</td>
                        <td class="style4">
                            <asp:Label ID="lblStopBit" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table> 
                </div>
                <div id="divComfirm" visible="false" style="position:absolute;left:176px; top:150px; width:218px; height:114px; background-color:#ddeeff;" runat="server"  >
                    <asp:Label ID="Label1" runat="server" Text="注意!! 若執行歸零，則此樓層內的所有電錶將全部歸零，且無法回復原值，請小心!" Font-Size="Medium"></asp:Label>
                    <br />
                    <asp:Label ID="Label2" runat="server" Text="密碼：" Font-Size="Medium"></asp:Label>
                    <asp:TextBox ID="tbPwd" runat="server" Width="117px"></asp:TextBox>
                    <br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnConfirm" runat="server" Text="確認" 
                        onclick="btnConfirm_Click" />
                    &nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnCancel" runat="server" Text="取消" onclick="btnCancel_Click" />
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
            </Triggers>
        </asp:UpdatePanel>
    </asp:Panel>
    </form>
</body>
</html>
